import {makeApi} from "@/api/ipc-api";
import {ipc} from "@/utils/ipcRenderer";
import {proxyToData} from "@/utils/fun";

let prefix = "controller.user."

let Api = makeApi(prefix)

Api.getBalance = async function (params) {
    return await ipc.request(prefix + 'getBalance', proxyToData(params))
}

Api.getRecords = async function (params) {
    return await ipc.request(prefix + 'getRecords', proxyToData(params))
}

Api.withdraw = async function (params) {
    return await ipc.request(prefix + 'withdraw', proxyToData(params))
}

Api.login = async function (params) {
    return await ipc.request(prefix + 'login', proxyToData(params))
}

Api.updateUserMoney = async function(){
    return await ipc.request(prefix + 'updateUserMoney')
}

Api.benefitsList = async function(){
    return await ipc.request(prefix + 'benefitsList')
}

export default Api
